{% load i18n jqmobile_tags %}
{% spaceless %}
<!DOCTYPE html>
<html{% if LANGUAGE_BIDI %} dir="rtl"{% endif %}>
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
        <meta name="format-detection" content="telephone=no">
        <meta name="robots" content="{% block robots %}NONE,NOARCHIVE{% endblock %}">
        <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}jqmobile/jquery.mobile/jquery.mobile.min.css">
        <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}jqmobile/css/jqmobile.css">
        {#<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}jqmobile/css/jquery.ui.datepicker.mobile.css" /> #}
        <script type="text/javascript" src="{{ STATIC_URL }}jqmobile/js/jquery.min.js"></script>
        {% block add_scripts %} {% endblock %}
        <script type="text/javascript" src="{{ STATIC_URL }}jqmobile/jquery.mobile/jquery.mobile.min.js"></script>
        <script>
        $.mobile.ajaxEnabled = false
        $.mobile.ajaxLinksEnabled = false
        $.mobile.ajaxFormsEnabled = false
        </script>
        {% block extrahead %}{% endblock %}
        {% block extrastyle %}{% endblock %}
    </head> 
	<body{# onorientationchange="updateLayout();"#}> 
		<div id="ma-index" data-role="page" data-theme="c">
		    <div data-theme="a" data-role="header" class="ui-bar-a ui-header" role="banner">
		        {% block app.header_left_button %}
		        {% if user.is_authenticated %}
		        <a href="#ma_options" data-icon="gear" data-iconpos="notext" data-role="button" class="ui-btn-left"></a>		{% endif %}
		        {% endblock %}
		        {# TODO: the default title should check for Grappelli title in settings before falling back to "Django Admin #}
		        <h1 tabindex="0" role="heading" aria-level="1" data-theme="a">{% block app.title %}{% trans "Django Admin" %}{% endblock %}</h1>
		        {% block app.header_right_button %}
				{% endblock %}
		    </div>
            {% block navbar %} {% endblock %}
            {% block messages %}{% endblock %}
			<div data-role="content">
				{% block content %}{% endblock %}
			</div>
			{% block page.footer %}{% endblock %}
		</div>

		{% block page.secondarypages %}
		{# options #}
		<div id="ma_options" data-role="page" data-theme="c" >
			 <div data-theme="a" data-role="header" class="ui-bar-a ui-header" role="banner">
				<a data-icon="back" href="{{ request.path }}" data-role="button" class="ui-btn-left">{% trans "Back" %}</a>
				<h1 tabindex="0" role="heading" aria-level="1" data-theme="a">{% trans 'Django administration' %}</h1>
				<a data-direction="reverse" data-icon="home" href="{% url jqmobile:index %}" title="{% trans "Home" %}" data-theme="a" data-role="button" data-iconpos="notext">{% trans "Home" %}</a>
			</div>
			<div data-role="content">    	
				<ul data-role="listview" data-inset="true" data-theme="c" data-dividertheme="c">
					{% block extra_options_head %}{% endblock %}
					<li class="group" data-theme="a">{% trans "Options" %}</li>
						{% if user.is_authenticated and user.is_staff %}						
						<li><a href="{% url jqmobile:password_change %}">{% trans "Change Your Password" %}</a></li>
						<li><a href="{# url admin:index #}/admin/">{% trans "Desktop Admin" %}</a></li>
						<li><a href="{% url jqmobile:auth_user_change request.user.id %}">{% trans "My Account" %}</a></li>
						<li><a href="#ma-actions">{% trans "My Recent Actions" %}</a></li>
		                {% url django-admindocs-docroot as docsroot %}
		                {% if docsroot %}
		               		<li><a href="{{ docsroot }}">{% trans "Documentation" %}</a></li>
		                {% endif %}
						{% block extra_options_footer %}{% endblock %}
					{% endif %}
					<li><a data-icon="delete" href="{% url jqmobile:logout %}">{% trans "Log out" %}</a></li>
				</ul>
			</div>
		</div>
		{# end options #}
		<div id="ma-actions" data-role="page" data-theme="c">
			<div data-theme="a" data-role="header" class="ui-bar-a ui-header" role="banner">
				<a data-icon="back" href="{{ request.path }}#ma_options" data-role="button" class="ui-btn-left">{% trans "Back" %}</a>
				<h1 tabindex="0" role="heading" aria-level="1" data-theme="a">{% trans 'Django administration' %}</h1>
				<a data-direction="reverse" data-icon="home" href="{% url jqmobile:index %}" title="{% trans "Home" %}" data-theme="a" data-role="button" data-iconpos="notext">{% trans "Home" %}</a>
			</div>
			<div data-role="content">
				<ul data-role="listview" data-inset="true" data-theme="c" data-dividertheme="c">
				    <li class="group" id="verbose_name" data-theme="a">{% trans 'My Actions' %}</li>
				    {% load log %}
				    {% get_admin_log 10 as admin_log for_user user %}
				    {% if not admin_log %}
				   	<li>{% trans 'None available' %}</li>
				    {% else %}
				    {% for entry in admin_log %}
						<li class="{% if entry.is_addition %}addlink{% endif %}
						{% if entry.is_change %}changelink{% endif %}
						{% if entry.is_deletion %}deletelink{% endif %}"
						>
						<p class="ui-li-count">{% if entry.is_addition %}{% trans "Added" %}{% endif %}
						{% if entry.is_change %}{% trans "Modified" %}{% endif %}
						{% if entry.is_deletion %}{% trans "Deleted" %}{% endif %}
						</p>
						{% if not entry.is_deletion %}
							<a href="{{ entry.get_admin_url }}">
						{% endif %}
						{% filter capfirst %}{% trans entry.content_type.name %}{% endfilter %}: 
						 <span id="entry_{{ entry.pk }}" data-theme="e">{{ entry.object_repr|escape }}</span>
						    {% if not entry.is_deletion %}</a>{% endif %}
						</li>
				    {% endfor %}
				    {% endif %}
				</ul>
			</div>
		</div>
		{% endblock %}
	</body>
</html>
{% endspaceless %}
